<style>
    .content {
        min-height: 800px;
    }
</style>

<body class="inside-header inside-aside is-dialog">
<div id="main" role="main">
    <div class="tab-content tab-addtabs">
        <div id="content">
            <div class="row">
                <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                    <section class="content-header hide">
                        <h1>
                            控制台 <small>Control panel</small>
                        </h1>
                    </section>
                    <div class="content">
                        <form id="edit-form" class="form-horizontal form-ajax" role="form" method="POST" action="">
                            <div class="form-group">
                                <label for="c-sort" class="control-label col-xs-12 col-sm-2">排序</label>:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input id="c-sort" class="form-control" name="row[sort]" type="number" value="<?=$row['sort']?>" placeholder="可为空">
                                </div>
                            </div>
                            <!-- <div class="form-group">
                                <label for="c-type" class="control-label col-xs-12 col-sm-2">级别:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select class="form-control" data-rule="required" name="row[type]">
                                        <option value="1" <?php if($row['type'] == 1):?>selected<?php endif;?>>第一级</option>
                                        <option value="2" <?php if($row['type'] == 2):?>selected<?php endif;?>>第二级</option>
                                        <option value="3" <?php if($row['type'] == 3):?>selected<?php endif;?>>第三级</option>
                                        <option value="4" <?php if($row['type'] == 3):?>selected<?php endif;?>>第三级</option>
                                    </select>
                                </div>
                            </div> -->
                            <div class="form-group">
                                <label for="parent_id" class="control-label col-xs-12 col-sm-2">父级:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <select class="form-control" required="true" name="row[parent_id]">
                                        <option value="0" selected="selected">请选择</option>
                                        <?php foreach($menu as $v):?>
                                        <option value="<?=$v['id']?>" <?php if($v['id'] == $row['parent_id']):?>selected<?php endif;?>>
                                        <?=$v['title']?>
                                        </option>
                                        <?php foreach($v['children'] as $c):?>
                                        <option value="<?=$c['id']?>" <?php if($c['id'] == $row['parent_id']):?>selected<?php endif;?>>
                                        <?php if(!empty($c['title'])):?>
                                        &nbsp;&nbsp;|--
                                        <?php endif;?>
                                        <?=$c['title']?>
                                        </option>
                                        <?php foreach($c['children'] as $t):?>
                                        <option value="<?=$t['id']?>" <?php if($t['id'] == $row['parent_id']):?>selected<?php endif;?>>
                                        <?php if(!empty($t['title'])):?>
                                        &nbsp;&nbsp;&nbsp;&nbsp;|----
                                        <?php endif;?>
                                        <?=$t['title']?>
                                        </option>
                                        <?php endforeach;?>
                                        <?php endforeach;?>
                                        <?php endforeach;?>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="url" class="control-label col-xs-12 col-sm-2">URL:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="url" name="row[url]" value="<?=$row['url']?>" disabled />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="action" class="control-label col-xs-12 col-sm-2">标题:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <input type="text" class="form-control" id="title" name="row[title]" value="<?=$row['title']?>" data-rule="required" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="icon" class="control-label col-xs-12 col-sm-2">图标:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <div class="input-group input-groupp-md">
                                              <span class="input-group-addon">
                                                  <i class="<?=$row['icon']?>" id="icon-style"></i>
                                              </span>
                                        <input type="text" class="form-control" id="icon" name="row[icon]" value="<?=$row['icon']?>">
                                        <a href="javascript:;" class="btn-search-icon input-group-addon">搜索图标</a>
                                    </div>
                                </div>
                            </div>


                            <div class="form-group">
                                <label for="memo" class="control-label col-xs-12 col-sm-2">备注:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <textarea class="form-control" id="memo" name="row[memo]"></textarea>
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="c-status" class="control-label col-xs-12 col-sm-2">状态:</label>
                                <div class="col-xs-12 col-sm-8">
                                    <label for="row[status]-normal">
                                        <input id="row[status]-normal" name="row[status]" type="radio" value="1" <?php if(!isset($row['status']) || $row['status'] == 1):?>checked<?php endif;?>> 正常
                                    </label>
                                    <label for="row[status]-hidden">
                                        <input id="row[status]-hidden" name="row[status]" type="radio" value="0" <?php if(isset($row['status']) && $row['status'] == 0):?>checked<?php endif;?>> 禁用
                                    </label>
                                </div>
                            </div>
                            <div class="form-group hidden layer-footer">
                                <div class="col-xs-2"></div>
                                <div class="col-xs-12 col-sm-8">
                                    <button type="submit" class="btn btn-success btn-embossed disabled">确定</button>
                                    <button type="reset" class="btn btn-default btn-embossed">重置</button>
                                </div>
                            </div>
                        </form>
                        <style>
                            #chooseicon {
                                margin: 10px;
                            }

                            #chooseicon ul {
                                margin: 5px 0 0 0;
                            }

                            #chooseicon ul li {
                                width: 30px;
                                height: 30px;
                                line-height: 30px;
                                border: 1px solid #ddd;
                                padding: 1px;
                                margin: 1px;
                                text-align: center;
                            }

                            #chooseicon ul li:hover {
                                border: 1px solid #2c3e50;
                                cursor: pointer;
                            }
                        </style>
                        <script id="chooseicontpl" type="text/html">
                            <div id="chooseicon">
                                <div>
                                    <form onsubmit="return false;">
                                        <div class="input-group input-groupp-md">
                                            <div class="input-group-addon">搜索图标</div>
                                            <input class="js-icon-search form-control" type="text" placeholder="">
                                        </div>
                                    </form>
                                </div>
                                <div>
                                    <ul class="list-inline">
                                        <% for(var i=0; i<iconlist.length; i++){ %>
                                        <li data-font="<%=iconlist[i]%>" title="<%=iconlist[i]%>">
                                            <i class="fa fa-<%=iconlist[i]%>"></i>
                                        </li>
                                        <% } %>
                                    </ul>
                                </div>

                            </div>
                        </script>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>